
Imports std
Imports System.IO

Module linereplace

    Public Sub main(ByVal args() As String)
        If isdebugmode() Then
            pause()
        End If

        If args.Length < 2 Then
            raiseError("argument count error, input output mapping0.0 mapping0.1 ... mappingN.0 mappingN.1" _
                       + ", program will transform backslashes", errorHandle.errorType.critical)
        Else
            Dim replacer As vector(Of pair(Of String, String)) = Nothing
            replacer = New vector(Of pair(Of String, String))
            dim i as int64
            For i = 2 To args.length() - 1 Step 2
                replacer.push_back(make_pair(args(i), args(i + 1)))
            Next
            
            gainshar.linereplace(replacer,args(0),args(1))
        End If
    End Sub

End Module
